//
//  ViewController.m
//  22作业
//
//  Created by dllo on 16/8/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "CustomTableViewCell.h"


@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong) UITableView *tableView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    [self.view addSubview:_tableView];
        
    _tableView.delegate = self;
    _tableView.dataSource = self;
    
    [_tableView registerClass:[CustomTableViewCell class] forCellReuseIdentifier:@"cell"];
    
    _tableView.rowHeight = 150;
}



- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 16;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
    CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        [cell.contentView addSubview:cell.customView2];
        return cell;
    } else {
        CustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        [cell.contentView addSubview:cell.customView1];
        [cell.contentView addSubview:cell.customView];
        [cell.contentView addSubview:cell.collection];
    return cell;
    }
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
